package app.business
{
	import flash.data.SQLConnection;
	import flash.filesystem.File;

	public class BaseConn
	{
		public function BaseConn()
		{
		}
		
		//获取数据库连接
		public static var _sqlConnection:SQLConnection;
		
		public function get sqlConnection():SQLConnection
		{
			if (_sqlConnection) 
			{
				return _sqlConnection;
			}else{
				var file:File =File.documentsDirectory.resolvePath("phb.s3db"); //创建数据库 在文档文档文件夹下 
				var fileExists:Boolean = file.exists;
				_sqlConnection = new SQLConnection();
				_sqlConnection.open(file);
				if (!fileExists)
				{
					//createTable();
					//populateDatabase();
				}
				return _sqlConnection;
			}
			
		}
	}
}